import 'package:base_plugin/base_plugin.dart';
import 'package:finance_app/generated/a.dart';
import 'package:finance_app/src/common/app_colors.dart';
import 'package:finance_app/src/widgets/select/mixin/check_box_mixin.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';

class NormalCheckBox extends StatelessWidget with CheckBoxMixin {
  final bool isSelect;
  final String title;
  final double minWidth;
  final double fontSize;
  final bool isEnable;

  const NormalCheckBox(
      {Key key,
      this.isEnable = true,
      this.isSelect,
      this.title,
      this.minWidth,
      this.fontSize = 18})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      constraints: BoxConstraints(
        minWidth: minWidth ?? getDp(110),
      ),
      child: Row(
        mainAxisSize: MainAxisSize.min,
        children: [
          buildSelectWidget,
          SizedBox(
            width: getDp(12),
          ),
          Text(
            title,
            style: TextStyle(
              color: aceBlackColor,
              fontSize: fontSize,
              fontWeight: isSelect ? FontWeight.w700 : FontWeight.w400,
              height: 1,
            ),
          )
        ],
      ),
    );
  }

  @override
  void debugFillProperties(DiagnosticPropertiesBuilder properties) {
    super.debugFillProperties(properties);
    properties.add(DoubleProperty('minWidth', minWidth));
    properties.add(StringProperty('text', title));
    properties.add(DiagnosticsProperty<bool>('isSelect', isSelect));
  }
}
